import request from '@/utils/request'

// 查询运营区域列表
export function listOperatingarea(query) {
  return request({
    url: '/business/operatingarea/list',
    method: 'get',
    params: query
  })
}

// 查询运营区域详细
export function getOperatingarea(id) {
  return request({
    url: '/business/operatingarea/' + id,
    method: 'get'
  })
}

// 新增运营区域
export function addOperatingarea(data) {
  return request({
    url: '/business/operatingarea',
    method: 'post',
    data: data
  })
}

// 修改运营区域
export function updateOperatingarea(data) {
  return request({
    url: '/business/operatingarea',
    method: 'put',
    data: data
  })
}

// 运营区域状态修改
export function changeOperatingareaStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/business/operatingarea/changeStatus',
    method: 'put',
    data: data
  })
}

// 删除运营区域
export function delOperatingarea(id) {
  return request({
    url: '/business/operatingarea/' + id,
    method: 'delete'
  })
}
